package com.naiterui.ehp.bs.doctor.repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bp.domain.DrConsultComplaint;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

/**
 * @Description 会话投诉
 * @Author gongbaoqiang
 * @Date 2020/7/1 4:31 PM
 */
@Repository
public interface IDrConsultComplaintRepository extends BaseJpaRepository<DrConsultComplaint, Long> {

    Page<DrConsultComplaint> findByDoctorIdOrderByIdDesc(Long  doctorId, Pageable pageable);

    /**
     * 根据会话id查询投诉
     * @param consultSessionId
     * @return
     */
    DrConsultComplaint findByConsultSessionId(Long consultSessionId);

    DrConsultComplaint findFirstByConsultSessionIdAndConsultType(Long consultSessionId, Integer consultType);
}
